#3和7整除

sum = 0

for i in range(1, 100):

    if i % 3 == 0 or i % 7 == 0:
        print(i, end=' ')

        sum += i

print("\n100以内能被3或7整除的数字和为：{}".format(sum))








#猜数字
# import random
#
# # 按照要求随机一次数字
# num = random.randint(0, 100)
# print("随机出来的数字为:", num)
# count = 0
# while count < 5:
#     try:
#         a = int(input("请输入一个整数："))
#         iscorrect = False
#         if a == num:
#             iscorrect = True
#             print("恭喜你!")
#             break
#         elif a > num:
#             count += 1
#             print("太大")
#         else:
#             count += 1
#             print("太小")
#
#         # 五次回答完成之后，判断是否需要继续
#         if not iscorrect and count == 5:
#             str = input("结束，是否继续?继续请输入y:")
#             if str == "y":
#                 count = 0
#     except ValueError:
#         print('请输入整数')

#九九乘法表
#for i in range(1,10):
#for j in range(1,i+1):
#print(f'{j}*{i}={i*j}\t',end='')
#print()

#水仙花数
# for n in range(100,1000):
#     i=n//100
#     j=n//10 %10
#     k=n%10
#     if n ==(i**3+j**3+k**3):
#         print(n)

        #100内质数



# i = 2
# for i in range(2, 1000):
#     j = 2
#     for j in range(2, i):
#         if (i % j == 0):
#             break
#     else:
#
#         print(i)
# # 打印输出
# print(i)


#打印100以内完数
for i in range(1,1001):
    a=0
    for j in range(1,i):
        if i % j==0:
            a += j
            if a== i:
                print(i)

                #
                # def fibonacci(n):
                #     a,b=0,1
                #     for _ in range(n):
                #     a,b =b, a+b
                #     return a
                # print(fibonacci(38))
#39列
            def fibonacci(n):
                a,b =0,1
                for _ in range(n):
                    a,b =b,a+b
                    return a
                print(fibonacci(38))
                #打印菱形
            # !/usr/bin/python
            # coding:utf-8

            rows = int(input('输入列数： '))

            # 打印菱形


            x=int(input('请输入一个奇数：'))
            s=x//2+1
            y=0
            for i in range(1,x+1):
                if i <=s:
                    print(' '*(s-i),'*'*(2*i-1))
                else:
                    y=y+1
                    print(' '*(i-s),'*'*(x+s-y-i))
